﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace AWP_Vl_2_Forms_HelloWorld2
{
    namespace GUI
    {
        class MyGUIComponent: Control
        {
            public MyGUIComponent()
            {
                MouseClick += MyMouseEventHandler;
            }

            protected override void OnPaint(PaintEventArgs e)
            {
                //SolidBrush b = new SolidBrush(Color.Red);
                //e.Graphics.FillRectangle(b, 0, 0, 100, 50);

                Pen p = new Pen(Color.Black, 3);
                e.Graphics.DrawRectangle(p, 0, 0, 100, 50);
            }

            private void MyMouseEventHandler(object sender, EventArgs e) 
            {
                Console.WriteLine("Click!");
            }
        }
    }
}